package com.jbm.jsm.iface;

import com.jbm.core.iface.IAcross;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;


@Entity
@Table(name = "user_authority_apply", schema = "", catalog = "jsm")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class UserAuthorityApplyEntity extends IAcross
{
    public UserAuthorityApplyEntity()
    {
        super();
    }

    public UserAuthorityApplyEntity(IAcross ia)
    {
        super(ia);
    }

    private int uaaId;
    private Integer createId;
    private String authority;
    private Timestamp createDate;
    private Integer status;
    private String refusereason;
    private Integer auditId;
    private Timestamp auditDate;
    public List<UserAuthorityApplyEntity> applylist;
    public UserEntity createUser;
    public List<AuthorityEntity> authoritylist;

    @Id
    @Column(name = "uaa_id")
    @GeneratedValue
    public int getUaaId() {
        return uaaId;
    }

    public void setUaaId(int uaaId) {
        this.uaaId = uaaId;
    }

    @Basic
    @Column(name = "create_id")
    public Integer getCreateId() {
        return createId;
    }

    public void setCreateId(Integer createId) {
        this.createId = createId;
    }

    @Basic
    @Column(name = "authority")
    public String getAuthority() {
        return authority;
    }

    public void setAuthority(String authority) {
        this.authority = authority;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "refusereason")
    public String getRefusereason() {
        return refusereason;
    }

    public void setRefusereason(String refusereason) {
        this.refusereason = refusereason;
    }

    @Basic
    @Column(name = "audit_id")
    public Integer getAuditId() {
        return auditId;
    }

    public void setAuditId(Integer auditId) {
        this.auditId = auditId;
    }

    @Basic
    @Column(name = "audit_date")
    public Timestamp getAuditDate() {
        return auditDate;
    }

    public void setAuditDate(Timestamp auditDate) {
        this.auditDate = auditDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserAuthorityApplyEntity that = (UserAuthorityApplyEntity) o;

        if (uaaId != that.uaaId) return false;
        if (auditDate != null ? !auditDate.equals(that.auditDate) : that.auditDate != null) return false;
        if (auditId != null ? !auditId.equals(that.auditId) : that.auditId != null) return false;
        if (authority != null ? !authority.equals(that.authority) : that.authority != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (createId != null ? !createId.equals(that.createId) : that.createId != null) return false;
        if (refusereason != null ? !refusereason.equals(that.refusereason) : that.refusereason != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = uaaId;
        result = 31 * result + (createId != null ? createId.hashCode() : 0);
        result = 31 * result + (authority != null ? authority.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (refusereason != null ? refusereason.hashCode() : 0);
        result = 31 * result + (auditId != null ? auditId.hashCode() : 0);
        result = 31 * result + (auditDate != null ? auditDate.hashCode() : 0);
        return result;
    }

    @Transient
    public List<UserAuthorityApplyEntity> getApplylist() {
        return applylist;
    }

    public void setApplylist(List<UserAuthorityApplyEntity> applylist) {
        this.applylist = applylist;
    }

    @Transient
    public UserEntity getCreateUser() {
        return createUser;
    }

    public void setCreateUser(UserEntity createUser) {
        this.createUser = createUser;
    }
    @Transient
    public List<AuthorityEntity> getAuthoritylist() {
        return authoritylist;
    }

    public void setAuthoritylist(List<AuthorityEntity> authoritylist) {
        this.authoritylist = authoritylist;
    }
}
